<?php
/**
 * Created by PhpStorm.
 * User: robert
 * Date: 2015/4/23
 * Time: 16:25
 */

class MemberBO {


    /**
     * 计算会员星级
     * @param $all_time
     * @return int
     * 星级计算规则，时间单位（分钟）
     *  star_level_1 = 0,5999,
        star_level_2 = 6000,17999
        star_level_3 = 18000,35999
        star_level_4 = 36000,59999
        star_level_5 = 60000,89999
        star_level_6 = 90000,100000000
     *
     */
    public static function getMemberLevel($all_time){

        $level=1;

        if($all_time<5999) return 1;
        if($all_time<17999) return 2;
        if($all_time<35999) return 3;
        if($all_time<59999) return 4;
        if($all_time<89999) return 5;
        if($all_time<100000000) return 6;
        if($all_time>100000000) return 6;

        return $level;
    }

}